package com.flower.service;

import com.flower.util.ResponseResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/*
 *@ClassName GoodsFeignFallBackFactory
 *@Description 整合feign客户端的第二种方式
 *@Author 吃麻椒的花酱
 *@Date 2021/6/24 1:20
 *@Version 1.0
 */
@Component
public class GoodsFeignFallBackFactory implements FallbackFactory<OrderFeign> {
    @Override
    public OrderFeign create(Throwable throwable) {
        return new OrderFeign() {
            @Override
            public Object getOrder() {
                return ResponseResult.error("正在维护，请稍后再试");
            }
        };
    }
}
